package com.sdx.console.promote.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.promote.dao.PromoteConfigDao;
import com.sdx.console.promote.entity.PromoteConfig;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 分销参数设置 Service
 */

@Service
@Transactional
public class PromoteConfigService extends BaseService<PromoteConfig>{

    @Resource
	private PromoteConfigDao promoteConfigDao;

    public PageQuery<PromoteConfig>queryByCondition(PageQuery query){
        PageQuery ret =  promoteConfigDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelPromoteConfig(List<String> ids){
        try {
            promoteConfigDao.batchDelPromoteConfigByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除分销参数设置失败", e);
        }
    }

	public List<PromoteConfig> all() {
		return promoteConfigDao.all();
		}
}